<%-- 
    Document   : examauto
    Created on : 2012-3-28, 21:21:57
    Author     : xiaoxiao
--%>

<%@page import="java.util.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib  prefix="s"  uri="/struts-tags"%>
<s:bean name="mytools.examDAO" id="ed"></s:bean>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>自动成卷</title>
        <link href="css/global.css" rel="stylesheet" type="text/css">
        <link href="css/form.css" rel="stylesheet" type="text/css">
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript" src="js/jquery.validate.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('#signup').validate({
                    rules: {
                        danxuan: {
                            required: true,
                            digits:true
                        },
                        duoxuan: {
                            required: true,
                            digits:true
                        },
                        judge: {
                            required: true,
                            digits:true
                        },
                        question: {
                            required: true,
                            digits:true
                        }
                    }, //end rules
                    messages: {
                        danxuan: {
                            required: '请输入题数',
                            digits: "请输入一个整数"
                        },
                        duoxuan: {
                            required: '请输入题数',
                            digits: "请输入一个整数"
                        },
                        judge: {
                            required: '请输入题数',
                            digits: "请输入一个整数"
                        },
                        question: {
                            required: '请输入题数',
                            digits: "请输入一个整数"
                        }
                    },
                    errorPlacement: function(error, element) {
                        if ( element.is(":radio") || element.is(":checkbox")) {
                            error.appendTo( element.parent());
                        } else {
                            error.insertAfter(element);
                        }
                    }

                }); // end validate
            }); // end ready()
        </script>
    </head>
    <body>
        <div id="contentWrap">
            <div id="main">
                <h2>自动出卷</h2>
                &nbsp;&nbsp;&nbsp;试卷<em><s:property value="%{#parameters.eid}"></s:property>&nbsp;</em> :
                <s:form action="examauto" method="post" name="signup" id="signup">
                    <s:hidden name="eid" value="%{#parameters.eid}"></s:hidden>
                    <div>
                        <label  class="label">选择科目</label>
                        <s:select list="%{#ed.getallsubject()}" name="subject"></s:select>
                    </div>

                    <div>
                        <label  class="label">选择章节</label>
                        <fieldset>
                            <s:iterator value="%{#ed.getallchapter()}" status="st" id="chapter">
                                <input type="checkbox" name="chapter" value="<s:property value="chapter"></s:property>" >
                                第<s:property value="chapter"></s:property>章
                            </s:iterator>
                        </fieldset>
                    </div>

                    <div>
                        <label  class="label">单选题数目</label>
                        <s:textfield name="danxuan"  id="timu" ></s:textfield> 
                    </div>
                    <div>
                        <label  class="label">多选题数目</label>
                        <s:textfield name="duoxuan"  id="timu1" ></s:textfield>
                    </div>
                    <div>
                        <label  class="label">判断题数目</label>
                        <s:textfield name="judge"  id="timu2" ></s:textfield> 
                    </div>
                    <div>
                        <label  class="label">主观题数目</label>
                        <s:textfield name="question"  id="timu3"></s:textfield>
                    </div> 
                    <div>
                        <input type="reset"  value="重置" id="examauto" >
                        <input type="submit" name="submit"  value="出卷" id="paper">
                        <input type="button" id="paper" onclick="location='epageAction.action'" value="返回">
                    </div>
                </s:form>
            </div>
        </div>
    </body>
</html>
